package com.jzy.bxb.app.manager;

import com.jzy.bxb.core.db.mongo.AbsMongoManager;
import com.jzy.bxb.model.mongo.dao.ConfigCityDao;
import com.jzy.bxb.model.mongo.dao.ConfigProvinceDao;
import com.jzy.bxb.model.mongo.dao.OrderDao;
import com.jzy.bxb.model.mongo.dao.ServerInfoDao;
import com.jzy.bxb.model.mongo.dao.SuggestDao;
import com.jzy.bxb.model.mongo.dao.UserDao;
import com.jzy.bxb.model.mongo.entity.ServerInfo;

/**
 * Mongodb
 *
 * @author JiangZhiYong
 * @date 2017-04-18 QQ:359135103
 */
public class MongoManager extends AbsMongoManager {
	private static MongoManager mongoManager = new MongoManager();

	private MongoManager() {

	}

	@Override
	public void createConnect(String configPath) {
		super.createConnect(configPath);
		initDAO();
	}

	/**
	 * 初始化dao
	 */
	private void initDAO() {
		UserDao.init(mongoManager);
		ServerInfoDao.init(mongoManager);
		SuggestDao.init(mongoManager);
		OrderDao.init(mongoManager);

		ConfigProvinceDao.init(mongoManager);
		ConfigCityDao.init(mongoManager);
	}

	public static MongoManager getInstance() {
		return mongoManager;
	}
}
